package IO;

import java.io.File;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 26727
 * Date: 2024-06-21
 * Time: 14:29
 */
public class IODemo2 {
    public static void main(String[] args) throws IOException {
        File file = new File("./hello world.txt");

        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isAbsolute());

        //创建文件
        file.createNewFile();

        System.out.println(file.exists());
        System.out.println(file.isDirectory());
        System.out.println(file.isFile());

        //删除文件之后
        file.delete();
        System.out.println(file.exists());
    }
}
